home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / UNIXLIB37B / !UnixLib37 / src / c / abs < prev    next >
Text File  |  1996-11-09  |  626b  |  32 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/c/RCS/abs,v $
  4.  * $Date: 1996/04/19 21:26:42 $
  5.  * $Revision: 1.1 $
  6.  * $State: Rel $
  7.  * $Author: simon $
  8.  *
  9.  * $Log: abs,v $
  10.  * Revision 1.1  1996/04/19 21:26:42  simon
  11.  * Initial revision
  12.  *
  13.  ***************************************************************************/
  14.  
  15. static const char rcs_id[] = "$Id: abs,v 1.1 1996/04/19 21:26:42 simon Rel $";
  16.  
  17. #include <stdlib.h>
  18.  
  19. int
  20. abs (register int x)
  21.  
  22. {
  23.   return ((x < 0) ? -x : x);
  24. }
  25.  
  26. long
  27. labs (register long x)
  28.  
  29. {
  30.   return ((x < 0) ? -x : x);
  31. }
  32.